<?php

namespace App\Containers\AppSection\Data\UI\API\Transformers;

use App\Containers\AppSection\Data\Models\Personal;
use App\Ship\Parents\Transformers\Transformer;

class PersonalTransformer extends Transformer
{
    protected array $defaultIncludes = [

    ];

    /**
     * @var  array
     */
    protected array $availableIncludes = [

    ];

    public function transform(Personal $t): array
    {
        return [
            'object' => $t->getResourceKey(),
            'include' => $this->getAvailableIncludes(),
            'id' => $t->getHashedKey(),
            'fio' => $t->fio,
            'without_patronymic' => $t->without_patronymic,
            'birth_date' => $this->dateFormatter($t->birth_date),
            'ogrnip' => $t->ogrnip,
            'position' => $t->position,
            'inn' => $t->inn,
            'snils' => $t->snils,
            'birth_place' => $t->birth_place,
            'registration_address' => $t->registration_address,
            'address_matches' => $t->address_matches,
            'residence_address' => $t->residence_address,
            'created_at' => $this->dateFormatter($t->created_at),
            'updated_at' => $this->dateFormatter($t->updated_at),
            'readable_created_at' => $t->created_at->diffForHumans(),
            'readable_updated_at' => $t->updated_at->diffForHumans()
        ];
    }
}
